﻿using System.Collections.Generic;
using System.ComponentModel;

namespace Lucy.Editor.Framework
{
    class ViewModel : INotifyPropertyChanged
    {
        private int _id;
        public int Id
        {
            get { return _id; }
            set
            {
                if (_id != value)
                {
                    _id = value;
                    FirePropertyChanged("Id");
                }
            }
        }

        public virtual IEnumerable<ViewModelCommand> ContextMenuCommands { get { yield return null; } }

        public event PropertyChangedEventHandler PropertyChanged;

        protected void FirePropertyChanged(string name)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(name));
        }
    }
}
